<%@ page import="java.util.List" %>
<%@ page import="com.foreknow.bean.Guestbook" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/12/1
  Time: 10:44
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">

</head>
<body>
    <div class="container">
        <table class="table table-hover">
            <tr>
                <th>id</th>
                <th>name</th>
                <th>phone</th>
                <th>email</th>
                <th>title</th>
                <th>content</th>
                <th>createdtime</th>
                <th>操作</th>
            </tr>
            <%
                //java代码
//        从request中获取list集合,然后遍历集合
                List<Object> list = (List<Object>)request.getAttribute("list");
                for (int i = 0;i<list.size();i++){
                    Guestbook guestbook = (Guestbook) list.get(i);
                    %>
                            <tr>
                                <td><%=guestbook.getId()%></td>
                                <td><%=guestbook.getName()%></td>
                                <td><%=guestbook.getPhone()%></td>
                                <td><%=guestbook.getEmail()%></td>
                                <td><%=guestbook.getTitle()%></td>
                                <td><%=guestbook.getContent()%></td>
                                <td><%=guestbook.getCreatedtime()%></td>
                                <td>
                                    <a href="/WebTest_01/m?q=jump" class="btn btn-primary">添加</a>
                                    <a href="/WebTest_01/m?q=jumpp&id=<%=guestbook.getId()%>" class="btn btn-warning">修改</a>
                                    <a href="/WebTest_01/m?q=delete&id=<%=guestbook.getId()%>" class="btn btn-danger">删除</a>
                                </td>
                            </tr>
            <%
                }
            %>
        </table>
    </div>
<script>



</script>
</body>
</html>
